home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / libs / libelf-0.5 / libelf-0 / libelf-0.5.2 / shared / Makefile.in
Encoding:
Makefile  |  1995-10-21  |  4.2 KB  |  155 lines

  1. # shared/Makefile for libelf.
  2. # Copyright (C) 1995 Michael Riepe <riepe@ifwsn4.ifw.uni-hannover.de>
  3. # This library is free software; you can redistribute it and/or
  4. # modify it under the terms of the GNU Library General Public
  5. # License as published by the Free Software Foundation; either
  6. # version 2 of the License, or (at your option) any later version.
  7. # This library is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  10. # Library General Public License for more details.
  11. # You should have received a copy of the GNU Library General Public
  12. # License along with this library; if not, write to the Free Software
  13. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14.  
  15. prefix = @prefix@
  16. exec_prefix = @exec_prefix@
  17. libdir = $(exec_prefix)/lib
  18.  
  19. CC = @CC@
  20. MV = mv -f
  21. RM = rm -f
  22. LN_S = @LN_S@
  23. INSTALL = @INSTALL@
  24. INSTALL_DATA = @INSTALL_DATA@
  25. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  26.  
  27. CFLAGS = @CFLAGS@
  28. CPPFLAGS = @CPPFLAGS@
  29. DEFS = -DHAVE_CONFIG_H
  30. LDFLAGS = @LDFLAGS@
  31. LIBS = @LIBS@
  32.  
  33. COMPILE = $(CC) -c -fPIC $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
  34.  
  35. # no user serviceable parts below
  36.  
  37. PACKAGE = @PACKAGE@
  38. VERSION = @VERSION@
  39. MAJOR = @MAJOR@
  40.  
  41. SHELL = /bin/sh
  42. @SET_MAKE@
  43.  
  44. srcdir = @srcdir@
  45. top_srcdir = @top_srcdir@
  46. VPATH = @srcdir@
  47.  
  48. topdir = ..
  49. subdir = shared
  50.  
  51. .SUFFIXES:
  52. .SUFFIXES: .c .o
  53. .c.o:
  54.     @$(RM) $@
  55.     $(COMPILE) $<
  56.  
  57. INCLUDES = -I$(topdir) -I$(srcdir)/..
  58.  
  59. # generic sources
  60. SRCS1 = begin.c cntl.c end.c errmsg.c errno.c fill.c flag.c getarhdr.c \
  61.     getarsym.c getbase.c getdata.c getident.c getscn.c hash.c kind.c \
  62.     ndxscn.c newdata.c newscn.c next.c nextscn.c rand.c rawdata.c \
  63.     rawfile.c strptr.c update.c version.c
  64. OBJS1 = begin.o cntl.o end.o errmsg.o errno.o fill.o flag.o getarhdr.o \
  65.     getarsym.o getbase.o getdata.o getident.o getscn.o hash.o kind.o \
  66.     ndxscn.o newdata.o newscn.o next.o nextscn.o rand.o rawdata.o \
  67.     rawfile.o strptr.o update.o version.o
  68.  
  69. # 32-bit sources
  70. SRCS2 = 32.fsize.c 32.getehdr.c 32.getphdr.c 32.getshdr.c 32.newehdr.c \
  71.     32.newphdr.c 32.xlatetof.c
  72. OBJS2 = 32.fsize.o 32.getehdr.o 32.getphdr.o 32.getshdr.o 32.newehdr.o \
  73.     32.newphdr.o 32.xlatetof.o
  74.  
  75. # support
  76. SRCS3 = cook.c data.c input.c
  77. OBJS3 = cook.o data.o input.o
  78.  
  79. # nlist
  80. SRCS4 = nlist.c
  81. OBJS4 = nlist.o
  82.  
  83. SRCS = $(SRCS1) $(SRCS2) $(SRCS3) $(SRCS4)
  84. OBJS = $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4)
  85.  
  86. # missing functions
  87. LIBSRCS = memset.c
  88. LIBOBJS = @LIBOBJS@
  89.  
  90. DISTFILES = Makefile.in
  91.  
  92. all: message shared
  93.  
  94. message:
  95.     @echo "    ----------------------------------------"
  96.     @echo "    In its current form, the \"shared\" target"
  97.     @echo "    will only work on Linux/ELF systems."
  98.     @echo "    If you can get it to work on another"
  99.     @echo "    system, please let me know how.    -- MR"
  100.     @echo "    ----------------------------------------"
  101.     @test "`uname`" = Linux
  102.     @sleep 2
  103.  
  104. shared: libelf.so.$(MAJOR)
  105.  
  106. libelf.so.$(MAJOR): $(OBJS) $(LIBOBJS)
  107.     @$(RM) $@ libelf.so.$(VERSION) libelf.so
  108.     $(CC) -shared -Wl,-soname,$@ $(LDFLAGS) $(OBJS) $(LIBOBJS) $(LIBS) -o $@
  109.     $(MV) $@ libelf.so.$(VERSION)
  110.     $(LN_S) libelf.so.$(VERSION) $@
  111.     $(LN_S) $@ libelf.so
  112.  
  113. $(SRCS) $(LIBSRCS):
  114.     @$(LN_S) $(topdir)/$@ $@
  115.  
  116. install: shared
  117.     $(INSTALL_PROGRAM) libelf.so.$(VERSION) $(libdir)
  118.     $(RM) $(libdir)/libelf.so $(libdir)/libelf.so.$(MAJOR)
  119.     cd $(libdir) && $(LN_S) libelf.so.$(VERSION) libelf.so.$(MAJOR)
  120.     cd $(libdir) && $(LN_S) libelf.so.$(VERSION) libelf.so
  121.  
  122. uninstall:
  123.     cd $(libdir) && $(RM) libelf.so libelf.so.$(MAJOR) libelf.so.$(VERSION)
  124.  
  125. mostlyclean:
  126.     $(RM) *~ core a.out errlist Log
  127.  
  128. clean: mostlyclean
  129.     $(RM) *.[oa] *.so* $(SRCS) $(LIBSRCS)
  130.  
  131. distclean: clean
  132.     $(RM) Makefile
  133.  
  134. maintainer-clean: distclean
  135.  
  136. distdir = $(topdir)/$(PACKAGE)-$(VERSION)/$(subdir)
  137. dist: $(DISTFILES)
  138.     for file in $(DISTFILES); do \
  139.       ln $(srcdir)/$$file $(distdir) || \
  140.         cp -p $(srcdir)/$$file $(distdir) || exit 1; \
  141.     done
  142.  
  143. # For the justification of the following Makefile rules, see node
  144. # `Automatic Remaking' in GNU Autoconf documentation.
  145.  
  146. Makefile: Makefile.in $(topdir)/config.status
  147.     cd $(topdir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
  148.  
  149. # Tell versions [3.59,3.63) of GNU make not to export all variables.
  150. # Otherwise a system limit (for SysV at least) may be exceeded.
  151. .NOEXPORT:
  152.